
import sys
import time
import random

print "Python starting."
sys.stdout.flush()
for i in range(100):
    r = random.randrange(10)
    if r == -1:
        raise "WHOAH"
    elif r < 5:
        sys.stdout.write("Howdy\n")
        sys.stdout.flush()
    else:
        sys.stderr.write("What's up?\n")
        sys.stderr.flush()
    time.sleep(random.random() * 1)

print "Python stopping."

sys.exit(12)
